package com.xmy.cultivate.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmy.cultivate.entity.Grade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xmy.cultivate.excel.StudentGradeExcel;
import com.xmy.cultivate.respons.SchedulingGrade;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 班级 服务类
 * </p>
 *
 * @author min
 * @since 2022-07-26
 */
public interface IGradeService extends IService<Grade> {
    public abstract Integer saveTo(Grade grade) throws ParseException;

    public abstract Integer updateTo(Grade grade) throws ParseException;

    public IPage<Grade> checkGrade(IPage<?> page, Wrapper wrapper, Long schoolId);
    //public abstract List<Map<String,Object>> checkGrade(Map<String,Object> map);

    public abstract IPage<Grade> findAll(IPage<?> page, Wrapper wrapper);

    public abstract List<Long> findGradeIdList(Wrapper wrapper);

    public abstract Grade getOneForId(Long id);

    List<Grade> getGradeForCheck(Long schoolId, Long courseId, Integer yearPart, Integer quarterNum, List<Long> gradeIdList, Long studentId);

    public abstract Boolean addStudent(String gradeId, String[] studentIdList);

    public abstract Boolean presortGrade(String gradeId, String[] studentIdList);

    public abstract Boolean endOfShift(Long gradeId);

    public abstract List<Grade> getRepairGrade(String schoolId, String courseId, String subjectsId, String gradeName, String lessonType, Integer yearPart, Integer quarterNum);

    List<SchedulingGrade> getGradeListForScheduling(Long schoolId, Integer subjectsId, Integer yearPart, Integer qurarterNum, String weekDates, Integer lessonType, Integer sourseLeve, Long adminId);

    List<String> getSchoolTimeList(Long schoolId, Integer yearPart, Integer qurarterNum, String weekDates, Integer lessonType);

    String getGradeTime(Long schoolId, Integer subjectsId, Integer yearPart, Integer qurarterNum, String weekDates, Integer lessonType);

    boolean agrainGrade(Grade grade);

    Grade getGradeOneForTeacherId(Integer yearPart, Integer qurarterNum, Long teacherId, Integer lessonType);

    List<StudentGradeExcel> workingScheduleNew(String schoolIdList, String name, String yearClassIdList, String subjectsId, String status, String classRoomIdList, String courseIdList, String yearPart, String quarterNumList, String teacherId, String isCheckHouse, String lessonType, String gradeIdList);

    List<StudentGradeExcel> workingScheduleBeforehandNew(String schoolIdList, String name, String yearClassIdList, String subjectsId, String status, String classRoomIdList, String courseIdList, String yearPart, String quarterNumList, String teacherId, String isCheckHouse, String lessonType, String gradeIdList);

    List<StudentGradeExcel> workingSchedulAccount(String schoolIdList, String name, String yearClassIdList, String subjectsId, String status, String classRoomIdList, String courseIdList, String yearPart, String quarterNumList, String teacherId, String isCheckHouse, String lessonType, String gradeIdList);

    public abstract IPage<Grade> getGradePosition(IPage<?> page, Wrapper wrapper);


    List<Grade> getPositionGradeList(Integer yearPart, Integer quarterNum, Long schoolId, Long subjectsId, Integer yearClassId, Integer lessonType, Integer type, BigDecimal score, Long classTypeId);

    public abstract IPage<Grade> getGradeFloatList(IPage<?> page, String yearPart, String quarterNum, String yearClassId, String courseTypeId, String subjectsId, String schoolId, String teacherId, String classRoomId, String gradeId, String isDescOrAsc, String isFieldToSc, String iSeal, String startDate, String endDate);

    /**
     * 班级列表中的课程表（单科）
     *
     * @param page
     * @param gradeId
     * @return
     */
    public abstract IPage<Grade> timetableByGradeId(IPage<?> page, Integer yearPart, Integer quarterNum, String gradeId, String subjectsId, Integer status, String studentName, Integer lessonType);

    /**
     * 班级列表中的课程表（多科）
     *
     * @param page
     * @param gradeId
     * @return
     */
    public abstract IPage<Grade> timetableByGradeIdList(IPage<?> page, Integer yearPart, Integer quarterNum, String gradeId, String subjectsId, String schoolId, String classRoomIdList, String courseIdList, String yearClassIdList, String name, String teacherId);

}
